﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BoatNGoat.Server;

namespace BoatNGoat.Logic
{
    public class PlayerMob : IUpdateable, IMobile
    {
        private readonly PlayerControlledBehaviour _controller = new PlayerControlledBehaviour();
        private readonly Goat _homunculus;

        public IPlayerController Controller
        {
            get
            {
                return (IPlayerController)_controller;
            }
        }

        public PlayerMob(int id, IMovementConstraint moveChecker)
        {
            _homunculus = new Goat(id, moveChecker, _controller);
        }

        public void Update(ServerTime serverTime)
        {
            _homunculus.Update(serverTime);
        }

        public int EntityId
        {
            get { return _homunculus.EntityId; }
        }

        public int EntityType
        {
            get { return 7; }
        }

        public SharpDX.Vector2 Velocity
        {
            get { return _homunculus.Velocity; }
        }

        public SharpDX.Vector2 Position
        {
            get
            {
                return _homunculus.Position;
            }
            set
            {
                _homunculus.Position = value;
            }
        }
    }
}
